﻿@model DateTime
<script src="@Url.Content("~/Scripts/jquery.ui.datepicker-zh-CN.js")" type="text/javascript"></script>
<script type="text/javascript">
	$(function () {
		var  myMinDate;
			  if(@ViewBag.PresentHour >16)
				{
				 myMinDate = 1;
				}
				else
				{
				myMinDate = 0;
				}
		$(".datepicker").datepicker({
			dateFormat: 'yy年m月d日',
			minDate: myMinDate,
			maxDate: 5,
			showOtherMonths: true,
			selectOtherMonths: true,
			showOn: "button",
			buttonImage: "../../images/calendar.gif",
			buttonImageOnly: true

		});
	});
</script>
<script type="text/javascript">
	function dateCheck() {
		var a = $(".datepicker")[0].value;
		if (a == "@ViewBag.Today") 
		{
			$("#slider-range").slider( "option", "min", @ViewBag.StartHour );
			$("#slider-range").slider(  "option", "values", [@ViewBag.StartHour ,18] );
		    $("#amount").val($("#slider-range").slider("values", 0) +
			":00 - " + $("#slider-range").slider("values", 1) + ":00");
		}
		else 
		{
			$("#slider-range").slider( "option", "min", 6 );
			$("#slider-range").slider(  "option", "values", [6 ,18] );
		    $("#amount").val($("#slider-range").slider("values", 0) +
			":00 - " + $("#slider-range").slider("values", 1) + ":00");
		}
	};

</script>
@Html.TextBox("", Model.Date.ToLongDateString(), new { @class = "datepicker", style = "width:90px;font-size:12px", onchange = "dateCheck()" })
